<script>
$(function(){
    $('#post').submit(function(){
		$.post(location.href,$(this).serialize(),function(data){
			alert(data.message);
			if (data.state <= 0)
			{
				return false;
			}
			window.location.reload();
		},'json');
        return false;
    });
});
</script>
<div class="line_1"></div>
<form id="post" method="post">

<div class="list-div" style="margin-bottom: 5px">
    <table cellspacing="1" width="100%">
        <tr><th colspan="4">采购历史记录</th></tr>
        <tr>
			<td><div align="center"><strong>执行人</strong></div></td>
            <th><div align="center"><strong>采购数量</strong></div></td>
            <th><div align="center"><strong>采购单价</strong></div></td>
            <th><div align="center"><strong>时间</strong></div></td>
        </tr>
		<?php foreach((array)$this->history as $item): ?>
		<tr>
			<td align="center"><?=$item['username']?></td>
			<td align="center"><?php echo $item['num']; ?></td>
			<td align="center"><?php echo $item['price']; ?></td>
			<td align="center"><?php echo date('Y-m-d H:i:s',$item['created_time']); ?></td>
		</tr>
		<?php endforeach; ?>
    </table>
</div>


<div class="list-div" style="margin-bottom:5px;">
    <table>
        <tr>
            <th colspan="4">信息录入</th>
        </tr>
        <tr>
            <td align="right" width="150px"><strong>采购数量：</strong></td>
            <td><input name="num" /></td>
        </tr>
        <tr>
            <td align="right"><strong>采购单价：</strong></td>
            <td><input name="price"/> </td>
        </tr>
		<tr>
			<td>&nbsp;</td>
			<td><input type="submit" value="提交" /></td>
		</tr>
    </table>
</div>

</form>